﻿<Window x:Class="Cyclops.MainApplication.View.Dialogs.NickAndStatusDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
        xmlns:ViewModel="clr-namespace:Cyclops.MainApplication.ViewModel"
        xmlns:ValueConverters="clr-namespace:Cyclops.MainApplication.ValueConverters" Height="232" Width="270"
        UseLayoutRounding="True" WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow" ResizeMode="NoResize"
        TextOptions.TextFormattingMode="Display" Loaded="WindowLoaded"
        Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
        TextOptions.TextRenderingMode="ClearType"
        Title="{Binding Path=Conference.NewNickDialogCaption, Source={StaticResource ResourceWrapper}}">
    <Window.Resources>

        <ValueConverters:StatusTypeToIntegerConverter x:Key="statusTypeConverter"/>

    </Window.Resources>
    
    <Grid Margin="0,10,0,10">
        <Grid.RowDefinitions>
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
            <RowDefinition Height="28" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="28" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="70" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>


        <TextBlock Grid.Row="0" Text="{Binding Path=Conference.CurrentUserNick, Source={StaticResource ResourceWrapper}}" Style="{StaticResource ParameterNameStyle}"/>
        <TextBox x:Name="nickTextBox" Grid.Row="0" Text="{Binding Nick, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="12" Width="159" Grid.Column="1" Style="{StaticResource valueStyle}"/>

        <ComboBox Grid.Row="1" Grid.Column="1" Width="159" Margin="10,4,8,4" HorizontalAlignment="Left" VerticalAlignment="Bottom"
                              SelectedIndex="{Binding StatusType, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource statusTypeConverter}}">
            <ComboBoxItem>Online</ComboBoxItem>
            <ComboBoxItem>Busy</ComboBoxItem>
            <ComboBoxItem>Away</ComboBoxItem>
            <ComboBoxItem>Not available</ComboBoxItem>
        </ComboBox>
        

        <TextBlock Grid.Row="1" Text="{Binding Path=Conference.CurrentUserStatus, Source={StaticResource ResourceWrapper}}" Style="{StaticResource ParameterNameStyle}"/>
        <TextBox Grid.Row="2" Text="{Binding Status, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" FontSize="12" Width="159" 
                 TextWrapping="Wrap" Grid.RowSpan="2" Height="46" VerticalAlignment="Top" Margin="10,3,0,0"
                 Grid.Column="1" Style="{StaticResource valueStyle}"/>
        <Button Grid.Row="4" Grid.Column="1" Command="{Binding ChangeCurrentUserVcard}" 
                            Content="{Binding Path=Conference.EditVcard, Source={StaticResource ResourceWrapper}}" Height="22" HorizontalAlignment="Left" Margin="10,0,0,0" FontWeight="Normal" Width="87" />


        <StackPanel Grid.Row="6" Grid.Column="1" Height="24" Margin="10,0,0,0" Orientation="Horizontal">
            <Button IsCancel="True" Command="{Binding Cancel}" Content="{Binding Path=Common.Cancel, Source={StaticResource ResourceWrapper}}" Width="76" Margin="0,0,8,0"/>
            <Button IsDefault="True" Command="{Binding Ok}" Content="{Binding Path=Common.Ok, Source={StaticResource ResourceWrapper}}" Width="76"/>
        </StackPanel>
    </Grid>
</Window>
